home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / send.z / send
Encoding:
Text File  |  2002-10-03  |  7.0 KB  |  199 lines

  1.  
  2.  
  3.  
  4. SSSSEEEENNNNDDDD((((2222))))                                                                SSSSEEEENNNNDDDD((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      send, sendto, sendmsg - send a message from a socket
  10.  
  11. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ssssoooocccckkkkeeeetttt....hhhh>>>>
  14.      iiiinnnntttt sssseeeennnndddd((((iiiinnnntttt ssss,,,, ccccoooonnnnsssstttt vvvvooooiiiidddd ****mmmmssssgggg,,,, iiiinnnntttt lllleeeennnn,,,, iiiinnnntttt ffffllllaaaaggggssss))));;;;
  15.      iiiinnnntttt sssseeeennnnddddttttoooo((((iiiinnnntttt ssss,,,, ccccoooonnnnsssstttt vvvvooooiiiidddd ****mmmmssssgggg,,,, iiiinnnntttt lllleeeennnn,,,, iiiinnnntttt ffffllllaaaaggggssss,,,,
  16.                ssssttttrrrruuuucccctttt ssssoooocccckkkkaaaaddddddddrrrr ****ttttoooo,,,, iiiinnnntttt ttttoooolllleeeennnn))));;;;
  17.      iiiinnnntttt sssseeeennnnddddmmmmssssgggg((((iiiinnnntttt ssss,,,, ccccoooonnnnsssstttt ssssttttrrrruuuucccctttt mmmmssssgggghhhhddddrrrr ****mmmmssssgggg,,,, iiiinnnntttt ffffllllaaaaggggssss))));;;;
  18.  
  19. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  20.      _S_e_n_d, _s_e_n_d_t_o, and _s_e_n_d_m_s_g are used to transmit a message to another
  21.      socket.  _S_e_n_d may be used only when the socket is in a _c_o_n_n_e_c_t_e_d state,
  22.      while _s_e_n_d_t_o and _s_e_n_d_m_s_g may be used when the socket is unconnected.
  23.  
  24.      The address of the target is given by _t_o with _t_o_l_e_n specifying its size.
  25.      The length of the message is given by _l_e_n.  If the message is too long to
  26.      pass atomically through the underlying protocol, then the error EMSGSIZE
  27.      is returned, and the message is not transmitted.
  28.  
  29.      Usually no indication of failure to deliver is implicit in a _s_e_n_d.
  30.      Return values of -1 indicate some locally detected errors.  Connected
  31.      datagram sockets may receive error indications from a previous _s_e_n_d.
  32.  
  33.      If no messages space is available at the socket to hold the message to be
  34.      transmitted, then _s_e_n_d normally blocks, unless the socket has been placed
  35.      in non-blocking I/O mode.  The _s_e_l_e_c_t(2) call may be used to determine
  36.      when it is possible to send more data.
  37.  
  38.      The _f_l_a_g_s parameter may include one or more of the following:
  39.  
  40.      #define   MSG_OOB        0x1  /* process out-of-band data */
  41.      #define   MSG_DONTROUTE  0x4  /* bypass routing,
  42.                               use direct interface */
  43.      #define MSG_DONT_BRKPG   0x100  /* don't break up pages for send */
  44.  
  45.  
  46.  
  47.      The flag MSG_OOB is used to send "out-of-band" data on sockets that
  48.      support this notion (e.g., SOCK_STREAM); the underlying protocol must
  49.      also support "out-of-band" data.  MSG_DONTROUTE is usually used only by
  50.      diagnostic or routing programs.  MSG_DONT_BRKPG is used to allow the
  51.      user, on a per send basis to stop page flipping and the break up of large
  52.      memory pages to 16k.  This can be done automatically for all large pages
  53.      transfers by setting the mtune/bsd/ip_nolgpg_brkup variable.  NOTE that
  54.      setting this can have a negative effect on performance.
  55.  
  56.  
  57.      See _r_e_c_v(2) for a description of the _m_s_g_h_d_r structure.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSEEEENNNNDDDD((((2222))))                                                                SSSSEEEENNNNDDDD((((2222))))
  71.  
  72.  
  73.  
  74. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  75.      The call returns the number of characters sent, or -1 if an error
  76.      occurred.
  77.  
  78. EEEERRRRRRRROOOORRRRSSSS
  79.      [EBADF]             An invalid descriptor was specified.
  80.  
  81.      [ENOTSOCK]          The argument _s is not a socket.
  82.  
  83.      [EFAULT]            An invalid user space address was specified for a
  84.                          parameter.
  85.  
  86.      [EMSGSIZE]          The socket requires that message be sent atomically,
  87.                          and the size of the message to be sent made this
  88.                          impossible.
  89.  
  90.      [EWOULDBLOCK]       The socket is marked non-blocking and the requested
  91.                          operation would block.
  92.  
  93.      [ENOBUFS]           The system was unable to allocate an internal buffer.
  94.                          The operation may succeed when buffers become
  95.                          available.
  96.  
  97.      [ENOBUFS]           The output queue for a network interface was full.
  98.                          This generally indicates that the interface has
  99.                          stopped sending, but may be caused by transient
  100.                          congestion.
  101.  
  102.      [ECONNREFUSED]      The remote port was invalid when using the _s_e_n_d call
  103.                          on a connected datagram socket.
  104.  
  105.      [EISCONN]           A _s_e_n_d_t_o or _s_e_n_d_m_s_g call was used on a connected
  106.                          socket.
  107.  
  108.      [EACCES]            The requested operation specified a broadcast address
  109.                          as the destination but the SO_BROADCAST socket option
  110.                          was not enabled (see _s_e_t_s_o_c_k_o_p_t(2)).
  111.  
  112.      [EHOSTUNREACH]      The remote host was unreachable via the network.
  113.  
  114.      [ENETUNREACH]       The remote network is unknown to the routing system.
  115.  
  116.      [EHOSTDOWN]         The remote host was determined to be down, possibly
  117.                          due to a failure to resolve its MAC-level address
  118.                          (see _a_r_p(7P)).
  119.  
  120. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  121.      fcntl(2), recv(2), select(2), getsockopt(2), socket(2), write(2)
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SSSSEEEENNNNDDDD((((2222))))                                                                SSSSEEEENNNNDDDD((((2222))))
  137.  
  138.  
  139.  
  140. NOTE
  141.      ABI-compliant versions of the above call can be obtained from
  142.      _l_i_b_s_o_c_k_e_t._s_o.
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.